﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace SmartLib.Cfg
{
    public class DBFactoriesElementCollection : ConfigurationElementCollection
    {
        protected override ConfigurationElement CreateNewElement()
        {
            return new DBFactoryElement();
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((DBFactoryElement)element).Name;
        }

        public override ConfigurationElementCollectionType CollectionType
        {
            get
            {
                return ConfigurationElementCollectionType.BasicMap;
            }
        }

        protected override string ElementName
        {
            get
            {
                return "DBFactory";
            }
        }

        public DBFactoryElement GetDBFactoryElement(int index)
        {
            return BaseGet(index) as DBFactoryElement;
        }
    }
}
